package com.jiuye.controller;

import com.jiuye.common.GlobalConstant;
import com.jiuye.common.R;
import com.jiuye.entity.Orders;
import com.jiuye.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.nio.file.LinkOption;

/**
 * 订单结算表示层
 *
 * @author likeWen
 * @since 2022/11/7 17:23
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private IOrderService orderService;

    /**
     * 用户下单
     */
    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){
        log.info("订单数据-->{}",orders);
        orderService.submit(orders);
        return R.success(GlobalConstant.SUCCESS);
    }
}
